package com.sh.data.engine.common.enumDefinition;

import java.util.Objects;

public enum TaskAlarmSubjectEnum {

    OFFLINE_SUBJECT(0, "离线计算"),
    ONLINE_SUBJECT(1, "实时计算"),
    DATAQUALITY_SUBJECT(2, "数据质量"),
    DATASYNC_SUBJECT(3, "数据集成");


    private int code;

    private String message;

    TaskAlarmSubjectEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public static String getNameByCode(Integer code) {
        Objects.requireNonNull(code);

        for (TaskAlarmSubjectEnum taskAlarmSubjectEnum : TaskAlarmSubjectEnum.values()) {
            if (code == taskAlarmSubjectEnum.code) {
                return taskAlarmSubjectEnum.message;
            }
        }
        return null;
    }
}
